package cn.yunyichina.utils.commons;

import com.thoughtworks.xstream.converters.basic.AbstractSingleValueConverter;

public class IntegerConverter extends AbstractSingleValueConverter {

	@Override
	public boolean canConvert(Class type) {
		 return type.equals(Integer.class);    
	}

	@Override
	public Object fromString(String str) {
		
		  if (str == null || str.trim().length() == 0) {
		      return null;
		  }
		   return Integer.decode(str);
	}
}

